package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_user")
public class UserBean {
    @TableId(value = "pk_userID",type = IdType.AUTO)
    private Integer id;
    @TableField("u_userName")
    private String userName;
    @TableField("u_password")
    private String password;
    @TableField("u_email")
    private String email;
    @TableField("u_imgPath")
    private String imgPath;
    @TableField("u_joinDate")
    private LocalDate joinDate = LocalDate.now();

    public UserBean() {
    }

    public UserBean(String userName, String password, String email, String imgPath) {
        this.userName = userName;
        this.password = password;
        this.email = email;
        this.imgPath = imgPath;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public LocalDate getJoinDate() {
        return joinDate;
    }

    public void setJoinDate(LocalDate joinDate) {
        this.joinDate = joinDate;
    }

    @Override
    public String toString() {
        return "\nUserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", imgPath='" + imgPath + '\'' +
                ", joinDate=" + joinDate +
                '}';
    }
}
